/**
 * 财务分析-现金流分析
 */
import React, { Component } from 'react';
// import { Link } from 'react-router-dom';
// import { Grid } from '@icedesign/base';
import IceContainer from '@icedesign/container';
import DataBinder from '@icedesign/data-binder';
// import { getBarOption } from '../../echarts-figures.js';
import TabSelect from '../../components/TabSelect/TabSelect';
import LineChart from './components/LineChart'
import './cashFlow.scss';

var echarts = require('echarts');

// const { Row, Col } = Grid;
const clsPrefix = 'cashFlow';
// TODO: 替换成自己的数据
@DataBinder({
  RDChartData: {
    // url: 'api/getTraditionalScoreChart',
    // url: `${global.constants.GOLDEYELOCALHOST}cattle/cash_flow_analysis`,
    url: `${global.constants.GOLDEYELOCALHOST}cattle/jianda_overiew`,
    type: 'get',
    // params: {
    //   secu_code: 000000111
    // },
    defaultBindingData: {}
  },
})

class cashFlow extends Component {

  constructor(props) {
    super(props);
    this.state = {
      RDChartID:"RDChart",
      numbers:{}
    };
    // 输入框
    this.value = '';
  }

  render() {
    const tabs = [{
      tab: "销售商品提供劳务收到的现金/营业收入",
      key: 0,
      des: "销售商品提供劳务收到的现金/营业收入指标反映了公司每单位的营业收入所能创造的现金流。"
    },{
      tab: "购买商品接受劳务支付的现金/营业成本",
      key: 1,
      des: "购买商品接受劳务支付的现金/营业成本指标反映了公司每单位营业成本所需要支付的现金流。"
    },{
      tab: "经营活动产生现金流量净额/营业收入",
      key: 2,
      des: "经营活动产生现金流量净额/营业收入指标反映了公司每增加一单位营业收入会增加多少经营现金流净额，指标越高则说明该公司从正常经营活动中获得现金流的能力越强，经营稳健，或者意味着该公司市场力量强势。"
    },{
      tab: "经营活动产生现金流量净额/营业利润",
      key: 3,
      des: "经营活动产生现金流量净额/营业利润指标反映每单位营业利润能产生的现金流净额。"
    }];

    let chartContent = [];
    for(let i=0;i<tabs.length;i++){
        chartContent.push((
            <div>
                <LineChart stockCode={this.props.stockCode} chartType="偿债能力" des={tabs[i].des} chartName={tabs[i].tab} />
            </div>
        ))
    }

    return (
      <div className={`page-${clsPrefix}`}>
        <IceContainer style={{borderRadius:'0'}}><TabSelect tabs={tabs} content={chartContent}/></IceContainer>
      </div>
    );
  }
}

export default cashFlow;
